package com.bykj.property.mapper.provider;

import com.bykj.property.controller.vo.request.NewsSendPageRequest;
import com.bykj.property.controller.vo.request.PaymentRecordPageRequest;
import org.apache.commons.lang3.StringUtils;
import org.apache.ibatis.jdbc.SQL;

/**
 * @author yiming
 * @title: PaymentRecordSql
 * @projectName property
 * @description: TODO
 * @date 2019/6/2921:50
 */
public class PaymentRecordSql {
    public String getSql(PaymentRecordPageRequest pageRequest){
        return new SQL() {
            {
                SELECT("*");
                FROM("payment_record");
                if(pageRequest.getChargeTypeId()!=null){
                WHERE("charge_type_id=#{chargeTypeId}");
                }
                if(pageRequest.getPmVillageId()!=null) {

                    WHERE("pm_village_id = #{pmVillageId}");
                }
                if(pageRequest.getPmUnitId()!=null) {

                    WHERE("pm_unit_id = #{pmUnitId}");
                }
                if(pageRequest.getPmProprietorId()!=null) {

                    WHERE("pm_proprietor_id = #{pmProprietorId}");
                }




            }
        }.toString();

    }

}
